package com.yonyou.pmclouds.repeatwork.process;

import com.yonyou.pmclouds.basecom.bp.processor.SingleProcessor;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.project.entity.ProjectConst;
import com.yonyou.pmclouds.project.entity.ProjectVO;
import com.yonyou.pmclouds.project.rmiitf.ProjectMaintain;
import com.yonyou.pmclouds.project.rmiitf.ProjectSimpleQuery;
import com.yonyou.pmclouds.repeatwork.entity.RepeatWorkVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class RepeatWorkLocalProjectProcessor implements SingleProcessor<RepeatWorkVO> {
    @Autowired
    private ProjectMaintain projectMaintain;

    @Autowired
    private ProjectSimpleQuery projectSimpleQuery;

    @Override
    public void process(RepeatWorkVO vo, RepeatWorkVO orig) throws BusinessException {
        ProjectVO projectVO = projectSimpleQuery.queryProject(vo.getPkProject());
        projectVO.setProjectState(ProjectConst.STATE_GOING);
        projectMaintain.updateAuth(projectVO,false);
    }
}
